/*   **********************************************************************  **
 **   Copyright notice                                                       **
 **                                                                          **
 **   (c) 2009, Around(J2)ME				                                 **
 **   All rights reserved.                                                   **
 **                                                                          **
 **   This program and the accompanying materials are made available under   **
 **   the terms of the New BSD License which accompanies this    			 **
 **   distribution.											                 **
 **   A copy is found in the textfile LICENSE.txt							 **
 **                                                                          **
 **   This copyright notice MUST APPEAR in all copies of the file!           **
 **                                                                          **
 **   Main developers:                                                       **
 **     Juri Strumpflohner		http://blog.js-development.com	             **
 **		Matthias Braunhofer		http://matthias.jimdo.com                    **
 **                                                                          **
 **  **********************************************************************  */

package com.aroundj2me.model;

import javax.microedition.location.Landmark;

/**
 * Business object representing a place
 */
public class Place {
	private Landmark landmark;
	private String continent;
	private String[] categories;
	private double distance;
	
	public Place() {
	}

	public void setLandmark(Landmark landmark) {
		this.landmark = landmark;
	}

	public Landmark getLandmark() {
		return landmark;
	}
	
	public void setContinent(String continent) {
		this.continent = continent;
	}

	public String getContinent() {
		return continent;
	}

	public void setCategories(String[] categories) {
		this.categories = categories;
	}

	public String[] getCategories() {
		return categories;
	}
	
	public String getCategoriesAsString() {
		StringBuffer categoriesString = new StringBuffer("");
		if (categories != null) {
			int noOfCategories = categories.length;
			for (int i = 0; i < noOfCategories - 1; i++) {
				categoriesString.append(categories[i]);
				categoriesString.append(";");
			}
			categoriesString.append(categories[noOfCategories-1]);
		}
		return categoriesString.toString();
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}
	
	public double getDistance() {
		return distance;
	}	
}
